Skip to content

Refactoring, use parametrized tests#32

Merged
alganet merged 1 commit into
mainfrom
parametrized-tests
Dec 17, 2025
Merged

Refactoring, use parametrized tests#32
alganet merged 1 commit into
mainfrom
parametrized-tests

Conversation

@alganet

@alganet alganet commented Dec 17, 2025

Copy link
Copy Markdown
Owner

Description

Brief description of changes.

Type of Change

  • Bug fix
  • Refactoring
  • New feature
  • Breaking change
  • Documentation update

Checklist

  • Descriptive and concise commit message and PR details
  • Docstrings updated
  • Documentation updated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the test suite to use pytest's parametrize decorator, consolidating similar tests into more maintainable parametrized versions. Additionally, it includes a small performance improvement by pre-compiling the placeholder regex pattern.

Key changes:

  • Consolidated similar test cases into parametrized tests across multiple test files
  • Introduced PLACEHOLDER_REGEX compiled constant to avoid repeated regex compilation
  • Refactored apywire/compiler.py with extracted helper methods for better code organization

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/test_stdlib_compat.py Consolidated 7 separate stdlib instantiation tests into 2 parametrized tests
tests/test_generator.py Consolidated type default tests and invalid format tests into parametrized versions
tests/test_formats.py Unified format roundtrip tests across JSON/TOML/INI into a single parametrized test class
tests/test_constant_placeholders.py Consolidated constant expansion tests into parametrized versions
tests/test_compile_aio.py Unified async compilation tests into parametrized versions
tests/test_cli.py Consolidated CLI flag and format tests into parametrized versions
apywire/constants.py Added pre-compiled PLACEHOLDER_REGEX constant for performance
apywire/wiring.py Updated to use the pre-compiled PLACEHOLDER_REGEX
apywire/runtime.py Updated to use the pre-compiled PLACEHOLDER_REGEX
apywire/compiler.py Extracted multiple helper methods to improve code organization and reduce duplication

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apywire/compiler.py Outdated
Comment thread tests/test_generator.py
Comment thread tests/test_formats.py
Comment thread tests/test_formats.py

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alganet alganet marked this pull request as ready for review December 17, 2025 21:18
@alganet alganet merged commit cf831dc into main Dec 17, 2025
12 checks passed
@alganet alganet deleted the parametrized-tests branch December 17, 2025 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants